<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
  * {
    margin: 0;
    padding: 0;
  }
  .container, .left, .main {
    height: 100vh;
  }
  .left {
    background-color: green;
  }
  .main {
    background-color: red;
  }
  .container {
    display: flex;
    /* width: 200px; */
  }
  .left {
    /* width: 300px; */
    flex-basis: 300px;  
    flex-shrink: 0; /* 当子容器大于父容器 不收缩 */
  }
  .main {
    flex: 1;
  }
  </style>
</head>
<body>
    <!-- flex-basis width 相同点和不同点
  css 如何实现左侧固定300px, 右侧自适应的布局?  -->
  <div class="container">
    <div class="left"></div>
    <div class="main"></div>
  </div>
</body>
</html>
